package org.smart4j.chapter2.util;

import java.util.Collection;
import java.util.Map;

/**
 * Created by xj on 2016/11/16.
 */
public class CollectionUtil {
    /***
     * 判断集合是否为空
     *
     * @param collection
     * @return
     */
    public static boolean isEmpty(Collection<?> collection) {
        return collection.isEmpty();
    }

    /***
     * 判断集合是否非空
     *
     * @param collection
     * @return
     */
    public static boolean isNotEmpty(Collection<?> collection) {
        return !collection.isEmpty();
    }

    /**
     * 判断MAP是否为空
     *
     * @param map
     * @return
     */
    public static boolean isEmpty(Map<?, ?> map) {
        return map.isEmpty();
    }

    /**
     * 判断MAP是否非空
     *
     * @param map
     * @return
     */
    public static boolean isNotEmpty(Map<?, ?> map) {
        return !map.isEmpty();
    }
}
